package com.followmeandroid.messages;

import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;

import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

/**
 * <p>Title: DeleteFriendRequest</p>
 * <p>Description: This class contains the data necessary
 * to send the server for a remove friend request</p>
 * @author Adam Drews
 * @email adam.drews@my.uwrf.edu
 * @date 11/17/2014
 * @team Tyler Johnson
 * @email tyler.johnson@my.uwrf.edu
 * @team Nicholas Thorp
 * @email nicholas.thorp@my.uwrf.edu
 */
public class DeleteFriendRequest extends ARequestBase {
    private String ExFriend;

    /**
     * Constructor for a delete friend request, with the
     * name of the friend to be deleted as the parameter.
     * @param exfriend      The name of friend to be removed.
     */
    public DeleteFriendRequest(String exfriend){
        ExFriend = exfriend;
    }

    /**
     * Constructor for a delete friend reqest, with the UUID
     * of the friend to be deleted as the parameter.
     * @param exfriend      The UUID of the friend to be removed.
     */
    public DeleteFriendRequest(UUID exfriend){
        ExFriend = exfriend.toString();
    }

    /**
     * Returns the name of the friend to be removed.
     * @return ExFriend     The name of the friend to be removed.
     */
    public String getExFriend() {
        return ExFriend;
    }

    /**
     * Sets the name of the friend to be removed.
     * @param exFriend      The name of the friend to be removed.
     */
    public void setExFriend(String exFriend) {
        ExFriend = exFriend;
    }

    /**
     * Returns a list of name value pairs for constructing a JSON
     * file to be sent to the server, noting the kind of field, and
     * the value of those fields.
     * @return paramsOut    Name of the friend to be removed, and the
     *                      member id of the person removing them.
     */
    public List<NameValuePair> toKeyValuePairs(){
        List<NameValuePair> paramsOut = new ArrayList<NameValuePair>();
        paramsOut.add(new BasicNameValuePair("exfriend",ExFriend));
        paramsOut.add(new BasicNameValuePair("memberid",memberid));
        return paramsOut;
    }
}
